home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 8
/
Eagles_Nest_Mac_Collection_Disc_8.TOAST
/
Developer Tools⁄Additions
/
InsideBa1994
/
InsideBasic-94
/
IB 94
/
PICT Animation
/
PICT Animation Demo (Z)
next >
Wrap
Text File
|
1992-07-30
|
2KB
|
88 lines
'________________________________________
'
' Original QB code by Raoul Watson
' ZBasic Conversion By Ross W. Lambert
' Copyright (C) 1991
' Ariel Publishing, Inc.
' All Rights Reserved
'________________________________________
DIM Hndl&(2) ' PICT handles
COORDINATE WINDOW
'Check IF We’Re Running Under Compiler UN-REM FOR ZBASIC 5.0 ONLY
'Hndl& = FN GETPICTURE(1000)
'LONG IF NOT Hndl&
'ResRef = FN OPENRESFILE("PICT Animation.Res")
'IF ResRef = 0 THEN END
'END IF
RESOURCES "PICT Animation.Res"
WINDOW 1,"Animation",(10,40)-(424,320),1
FOR P = 0 TO 2
Hndl&(P) = FN GETPICTURE(1000+P)
NEXT
Ty%=100 'the Y scan line
PLOT 0,Ty%+36 TO 440,Ty%+36 'the road
Count%=0 'picture index
Delayfac=-1.8 'from "kinda" fast
' (see QB comments about leading &
' Trailing Space)
FOR X%=-99 TO 300 STEP 2 'move right
'The delay routine serves 2 needs:
'1. So you can control the speed
'2. To avoid VBL flicker (when the
' refresh beats the image plotting
' on the screen
GOSUB "Delay"
PICTURE (X%,Ty%),Hndl&(Count%)
Count%=Count%+1
IF Count%>2 THEN Count%=0 'wrap
Delayfac!=Delayfac!+.02
NEXT
' final pict should be the 1st one
PICTURE (X%,Ty%),Hndl&(0)
' record end pos for forward move
Endtruck%=X%+102
Delayfac!=60
GOSUB "Delay"
' Now move the truck to the left
Count%=0
Delayfac!=3 ' From very slow
FOR X%=Endtruck%-102 TO -100 STEP -3'it leaves faster...
GOSUB "Delay"
PICTURE (X%,Ty%),Hndl&(Count%)
Count%=Count%+1
IF Count%>2 THEN Count%=0
Delayfac!=Delayfac!-.2
NEXT X%
END
'-----------------------------------
' see QB delay comments
"Delay"
Ticks& = FN TICKCOUNT
T&=Ticks&+Delayfac!
WHILE Ticks& < T&
Ticks& = FN TICKCOUNT
WEND
RETURN